home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / wgt_tp1.zip / FEATURE.DOC < prev    next >
Text File  |  1992-07-05  |  3KB  |  70 lines

  1. WordUp Graphics Toolkit
  2. -----------------------
  3.  
  4. Important Features:
  5.  
  6.     Two very important and useful features have been included with this
  7. kit. They are public variables available to your program, which are used by
  8. the WGT to process information.
  9.  
  10.  
  11. Memory Issues
  12. -------------
  13.  
  14.     This first is simply a tool for those who like to keep track of their
  15. program's memory usage. The WGT uses a lot of dynamic memory allocation, and
  16. currently very little error checking. Some programs which work fine on the
  17. developer's computer may not have enough memory to run on someone else's.
  18. To use the variable, run your program through (entirely) once. Upon its
  19. completion, go to the Debug 'Evaluate and Modify' menu selection. At the
  20. Expression prompt, type MEMORY_USAGE. The result box should display a number.
  21. This is the number (in bytes) of memory your program used as overhead during
  22. its execution. You can add a line at the beginning of your program which will
  23. check available memory and stop execution if this figure can't be met.
  24.  
  25.     For example, if you run your program and MEMORY_USAGE reveals a size
  26. of 45000, you would then start your program out like
  27.  
  28. IF MaxAvail < Memory_Usage then 
  29.     BEGIN
  30.         Writeln('This program requires 45000 bytes of free memory.');
  31.         Halt(0); {This line stops execution of the program}
  32.     END
  33. ELSE .......
  34.  
  35.  
  36.  
  37. Graphics Pages
  38. --------------
  39.  
  40.     Some video modes allow users to set a visual and an active page. This
  41. means that while the user watches one screen, the computer can be drawing on
  42. another. Many animation sequences are created by flipping from page to page.
  43. Unfortunately, the 320*200*256 mode does not support these pages. The WGT does
  44. however provide a 'False' version of these pages. Our active page may change,
  45. but the visual page is always set.
  46.  
  47.     We use the Init_Screen to allocate memory for a different screen of
  48. memory to be used. The screen is referenced by a pointer. This allows us to
  49. create and remove screens of memory, but how do we select them for use?
  50. Two variables are utilized to make paging easy. The first is a constant which
  51. refers to the visual screen. This is called BASESCREEN. The second is set
  52. by the program to tell WGT which screen to draw on. This one is called
  53. CURRENTSCREEN. We assign it values like any other variable.
  54.  
  55.     Let's assume you have initialized another screen called SECOND. The
  56. following program segment will draw a circle on that screen, copy the entire
  57. screen to the visual screen, and then draw a box on the visual screen.
  58.  
  59.     currentscreen := SECOND;
  60.     _Circle(100,100,40);
  61.     Copy_Screen(0,0,319,199,second,0,0,basescreen);
  62.     currentscreen := BASESCREEN;
  63.     _Box(10,40,150,90);
  64.  
  65. Notice that Copy_Screen ignores the currentscreen variable and requires two
  66. pointer names directly. This means that copying is not limited to the visual
  67. screen. Parts of a second screen could be copied to a third or fourth. The
  68. final result must always be copied to the basescreen to be seen.
  69.  
  70.